package com.maretska.java.basic;

import org.junit.Test;

public class ConditionalLearn {
	
	@Test
	// Conditional loop
	public void conditional(){
		int a = 0;
		int b = 10;
		int c = a+b;
		// name of variable = condition ? value true : value false
		int d = (c==10) ? 10 : 30;
		System.out.println("Hasil dari : " +d);
		
	}
	
	@Test
	public void printCharClass(){
		// cek bener character apa bukan
		System.out.println(Character.isLetter('c'));
		System.out.println(Character.isLetter('5'));
		
		// for check digit or not
		System.out.println(Character.isDigit('a'));
		System.out.println(Character.isDigit('5'));
		
		//for check white space
		System.out.println(Character.isWhitespace('c'));
		System.out.println(Character.isWhitespace(' '));
		System.out.println(Character.isWhitespace('\n'));
		System.out.println(Character.isWhitespace('\t'));
	      
	    //for check uppercase character
		System.out.println( Character.isUpperCase('c'));
		System.out.println( Character.isUpperCase('C'));
		System.out.println( Character.isUpperCase('\n'));
		System.out.println( Character.isUpperCase('\t'));
		
		//for check lowerCase character
		System.out.println(Character.isLowerCase('c'));
		System.out.println(Character.isLowerCase('C'));
		System.out.println(Character.isLowerCase('\n'));
		System.out.println(Character.isLowerCase('\t'));
		
		//for change into uppercase
		System.out.println(Character.toUpperCase('c'));
		System.out.println(Character.toUpperCase('C'));
		
		//for change into lowerCase
		System.out.println(Character.toLowerCase('c'));
		System.out.println(Character.toLowerCase('C'));
	}
}
